package ssmDemo.controller;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.context.support.WebApplicationContextUtils;

import ssmDemo.bean.Student;
import ssmDemo.service.StudentService;

@Controller
@RequestMapping(value="/student")
public class StudentAction {
	
	private static Logger logger = Logger.getLogger(StudentAction.class);
	@Autowired
	private StudentService studentService;

	/**
	 * http://localhost:8091/student/addStudent?sid=105&sname=ewewq&sgid=90
	 * @param sid
	 * @param sname
	 * @param sgid
	 */
	@RequestMapping(value="/addStudent")
	public void addStudent(Integer sid, String sname, Integer sgid){
		Student student = new Student(sid, sname, sgid);
		studentService.addStudent(student);
	}
	
}
